/*
 * Sprite.h
 *
 *  Created on: 2009/01/29
 *      Author: Yongshik Cho
 */

#ifndef SPRITE_H_
#define SPRITE_H_

#include "RenderObjectContainer.h"
#include "Tile.h"
#include "Path.h"
#include "sqplus/sqplus.h"
using namespace SqPlus;

class Sprite : public RenderObjectContainer
{
public:
	Sprite(Tile* tile = 0);
	virtual ~Sprite();

public:
	virtual void addTile(Tile* tile);
	virtual void subTile(Tile* tile);
	virtual void animate(const String& name);
	virtual void animate(const uint32 index);
	virtual void animate(const String& name, const uint8 loopType, const uint32 loopCount);
	virtual void animate(const uint32 index, const uint8 loopType, const uint32 loopCount);
	virtual void tween(const String& name);
	virtual void tween(const uint32 index);
	virtual void tween(const String& name, const uint8 loopType, const uint32 loopCount);
	virtual void tween(const uint32 index, const uint8 loopType, const uint32 loopCount);
	virtual void setTweenable(const String& tween, Tweenable* twn);
	virtual void setCollideType(const uint8 type);
	virtual const bool in(const Vector2D& p);
	virtual const Rect2D& getRect();
	virtual void setFlipType(const uint8 type);
	virtual void setBlendColor(const Color& c);
	virtual void setPosition(const Vector2D& position);
	virtual void setAlpha(uint8 alpha);
	virtual void render();
	virtual void setBlendType(const int32 type);
	virtual void pushRenderables(vector<Renderable*>& vp, vector<Renderable*>& nosort);
	virtual const Rect2D getViewRect();

	virtual void onMouseEvent(const Event& e);

	inline const uint32 getPathCount() const { return (uint32)mPaths.size(); }
	Path* getPath(uint32 index);
	Path* getPathByName(const String& name);
	void addPath(Path* path);

private:
	vector<Path*>	mPaths;
};

//must be declared here
DECLARE_INSTANCE_TYPE(Sprite)

#endif /* SPRITE_H_ */
